﻿using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;

public class PathDefine
{
    public static readonly string FileList = "/FileList";
    public static string AssetBundleName = "AssetBundle";

    public static string PersistentDataPath{ get => Application.persistentDataPath; }
    public static string StreamingAssetsPath {
        get {
#if !UNITY_EDITOR && UNITY_ANDROID
            return Application.streamingAssetsPath;
#else
            return string.Format("file:///{0}", Application.streamingAssetsPath);
#endif
        }
    }
    public static string PersistentAssetsPath { get => string.Format("{0}/Assets", PersistentDataPath); }
    public static string PersistentBundlePath { get => string.Format("{0}/{1}", PersistentAssetsPath, AssetBundleName); }
    public static string StreamingBundlePath { get => string.Format("{0}/{1}", StreamingAssetsPath, AssetBundleName); }

#region About build
    /// <summary>
    /// 构建路径 Build/
    /// </summary>
    public static string BuildPath {
        get =>
            string.Format("{0}/Build", Directory.GetParent(Directory.GetParent(Application.dataPath).FullName).FullName);
    }
    /// <summary>
    /// 构建时所有资源存放路径Build/Assets
    /// </summary>
    public static string BuildAssetPath { get => string.Format("{0}/Assets", BuildPath); }

    /// <summary>
    /// 构建时所有AssetBundle资源存放路径Build/Assets/AssetBundle
    /// </summary>
    public static string BuildBundlePath { get => string.Format("{0}/AssetBundle", BuildAssetPath); }
    /// <summary>
    /// 平台名字
    /// </summary>
    public static string PlatformName {
        get {
#if UNITY_ANDROID
            return "Android";
#elif UNITY_IOS
            return "IOS";
#else
            return "EDITOR";
#endif
        }
    }
    /// <summary>
    /// 打包路径
    /// </summary>
    public static string PackPath { get => string.Format("{0}/{1}", BuildPath, PlatformName); }
#endregion
}
